{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Logistic Regression\n",
    "==================="
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "First, we generate some data to train to train with."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.datasets import make_blobs\n",
    "X, y = make_blobs(centers=2)   # generate dataset consisting of two Gaussian clusters"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Take a look at how large the data is and what the labels look like:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "X.shape: (100, 2)\n",
      "y:  [1 0 0 1 1 0 1 0 0 0 1 0 1 1 1 0 0 1 0 0 0 0 1 1 1 1 1 1 1 1 1 0 0 1 1 0 0\n",
      " 0 1 0 0 1 0 1 0 1 1 0 0 1 1 0 1 1 1 1 0 1 0 1 1 0 1 1 0 0 0 1 0 1 1 0 1 0\n",
      " 1 0 0 1 1 1 0 0 0 0 1 0 0 0 1 0 0 0 1 1 0 1 0 1 0 0]\n"
     ]
    }
   ],
   "source": [
    "print \"X.shape:\", X.shape \n",
    "print \"y: \", y "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "As the data is two-dimensional, we can easily visualize it:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0xa65ce6c>"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXkAAAD9CAYAAABZVQdHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlcVPX+x/HXDMuwCoi5omCogFdUVIQ0E3fc17LytohZ\nLmVmLp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kZKStS7KZEuVEmX0U\nfA0WLVpk+Pn5GS4uLka1atWM6OjoouemTZtmBAYGGiEhIUZ8fPyNLKtCeOCBB4zQ0FCjefPmxlNP\nPXXLzayIi4szgoODjcDAQGP69Om2LsemDh8+bDRp0sRo0qSJ0b59e+Ojjz6ydUk3zL333mvUqFHD\ncHZ2Nvz8/IxZs2bdslMofz8WTk5Ohp+fn/HRRx+VKCdMhqEBLxERe1UhZteIiEj5UMiLiNgxhbyI\niB1TyIuI2DGFvIiIHVPIi4jYsf8DukTFtk9nJv0AAAAASUVORK5CYII=\n"
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.prism()\n",
    "plt.scatter(X[:, 0], X[:, 1], c=y)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Import logistic regression from scikit-learn and generate a classification object."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.linear_model import LogisticRegression\n",
    "logreg = LogisticRegression()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Split the dataset into a training set and a test set."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "X_train = X[:50]\n",
    "y_train = y[:50]\n",
    "X_test = X[50:]\n",
    "y_test = y[50:]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "To get an idea of how hard the task is, let us visualize the data again, this time only labeling the training points.\n",
    "\n",
    "The test points are plottet as white triangles.\n",
    "Can we see which class the test points belong to?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0xabbe70c>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXkAAAD9CAYAAABZVQdHAAAABH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mqFZ7k2lpaWGDNmDMLDw/HJJ5/UQFW6FxAQgIkTJ5Zt\nJyUloUePHjqsSPcaNmwIAPD29kafPn0QGRmJ9957T8dV6UZAQAAuXrwIf39/XLx4UZLZ8Kzq168P\noGI5obPpmn/+79y6dWscOHAA6enpUCgU0NPTg7m5ua5K04mbN28CAFQqFTZu3IhevXrpuKKaY2lp\nCQCIiopCWloaDh06hMDAQB1XpTsFBQVlv4ZnZWXhwIEDL/R/eoGBgVi1ahUKCwuxatUqBAUF6bok\nnalUTmjtreBnsGPHDtGoUSNhbGwsGjRoIHr06FH23IIFC4Sbm5vw9vYWUVFRNVlWrfDWW28JHx8f\n0bJlS/Hhhx++cCsrFAqF8PLyEm5ubmLhwoW6Lkenrl69Knx9fYWvr6/o3LmzWLlypa5LqjGDBw8W\nDRs2FIaGhqJRo0Zi1apVL+wSyr+vhVwuF40aNRIrV66sVE7IhOCEFxGRVNWK1TVERFQ9GPJERBLG\nkCcikjCGPBGRhDHkiYgkjCFPRCRh/wec8kSBPkpGngAAAABJRU5ErkJggg==\n"
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.prism()\n",
    "plt.scatter(X_train[:, 0], X_train[:, 1], c=y_train)\n",
    "plt.scatter(X_test[:, 0], X_test[:, 1], c='white', marker='^')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "That doesn't look too hard.\n",
    "\n",
    "Now let's fit the logistic regression model to the training data, to see if we can do it automatically:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LogisticRegression(C=1.0, class_weight=None, dual=False, fit_intercept=True,\n",
       "          intercept_scaling=1, penalty='l2', random_state=None, tol=0.0001)"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "logreg.fit(X_train, y_train)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "First, we have a look at how logistic regression did on the training set.\n",
    "\n",
    "We do this by now setting colors using the predicted class."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAV0AAADtCAYAAAAcNaZ2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAH89JREFUeJzt3Wd8VNXaxuH/JJM2SYQECISiEJCOCBh6NyDFQ1Egdg4I\nHkSxHAUEfVXUY0GKimBBRLCCiqBYwAJSE0JvgnQBaQktvc16P2xEFCGUzJ6U+/pEMjN7P5sfudlZ\ne631OIwxBhERsYWPtwsQESlOFLoiIjZS6IqI2EihKyJiI4WuiIiNnOd6weFw2FmHiEiRcb5JYecM\n3bw+KCIiZ8vrhlXDCyIiNlLoiojYSKErImIjha6IiI0UuiIiNlLoiojYSKErImIjha6IiI0UuiIi\nNipSoZubm0tycrK3yxAROaciE7pT3n6bksHBlA0PJ7p2bfbu3evtkkREzuI4V7seh8NRaPZeSEhI\noHvbtixIS6M68JyvL/Pr1WPxmjXeLk1Eipm8srNI3OnGx8fT3e2mBuAAhuXmsnz9+kLzn4aIFB9F\nInTLly/PSqeTrFNfxwGRYWHanlJECpwiEbo9evTgqlatuC4khNjQUHq5XEz+4ANvlyUicpYiMaYL\n4Ha7+fHHHzly5AhNmjShatWq3i5JRIqhvLKzyISuiEhBUCwepImIFBYKXRERGyl0RURspNC9CAsX\nLqRNgwY0qFqVJx97jJycHG+XJCKFjEL3Aq1bt47eXbty39q1vLVzJ4smTGDkI49w/PhxenfpQpjL\nxdXlyzN37lxvlyoiBZhmL5whNTWVadOmkZSYSPvrr6dFixanXxv19NOkP/ssL7rdAGwDrg8PJ6pa\nNRITEqhpDNHAC76+vPXhh8TGxnrnIkTEqzR74QKlp6fTJjqa+Y8+SvqoUfTp2JEP3n+fjIwMNmzY\nQGZWFkm+vqffnwTg40PCihUMNIbOwGtA49xc7r7rLtauXeul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P6vteU5ODp988gmrVq1i8tS3qHBrLibTwdHvgs5q47Nr1y7mzJmDv78/vXv3\npkyZMjZfkVwKbXgjUkDt2rWLWbNm4evrS2xsLJGRkd4uSfKBQldExEZqTCkiUoAodEVEbKTQFRGx\nkUJXRMRGCl0RERspdEVEbKTQFRGxkUJXRMRGCl0RERspdEVEbKTQFRGxkUJXRMRGCl0RERspdEVE\nbKTQFRGxkUJXRMRGCl0RERspdEVEbKTQFRGxkUJXRMRGCl0RERspdEVEbKTQFRGxkUJXRMRGCl0R\nERspdEVEbKTQFRGxkUJXRMRGCl0RERspdEVEbKTQFRGxkUJXRMRGCl0RERspdEVEbKTQFRGxkUJX\nRMRGCl0RERs5z/eiw+Gwqw4RkWLhnKFrjLGzDhGRYkHDCyIiNlLoiojYSKErImIjha6IiI0UuiIi\nNlLoiojY6P8B89y1HqfLjHwAAAAASUVORK5CYII=\n"
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from utility import plot_decision_boundary\n",
    "y_pred_train = logreg.predict(X_train)\n",
    "plt.scatter(X_train[:, 0], X_train[:, 1], c=y_pred_train)\n",
    "plot_decision_boundary(logreg, X)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "That looks pretty good. It is not always that easy to inspect the result visually,\n",
    "so we can also use the logistic regression object to calculate a core for us:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Accuracy on training set: 1.0\n"
     ]
    }
   ],
   "source": [
    "print \"Accuracy on training set:\", logreg.score(X_train, y_train)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "1.0 means an accuracy of 100%, just as it looked like.\n",
    "\n",
    "Now let us have a look at how the algorithm generalizes to the test data."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Accuracy on test set: 1.0\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAV0AAADtCAYAAAAcNaZ2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xd0VFXXx/HvTCaZzCQhhZaECBgIHQEjvYQqAoqIojy8\n+tgVQQFFilgooigtCoIUFUFFFEUQEBRRBKSXgBh6kyKE0NInycx+/7iI8FBCSWZS9mct1jJT7uw7\ny/y4nHvO2SYREZRSSrmF2dMFKKVUUaKhq5RSbqShq5RSbqShq5RSbqShq5RSbmS50hMmk8mddSil\nVKFxtUlhVwzdnN6olFLqUjldsOrwglJKuZGGrlJKuZGGrlJKuZGGrlJKuZGGrlJKuZGGrlJKuZGG\nrlJKuZGGrlJKuZGGrlJKuVGhCl2n00lycrKny1BKqSsqNKH78ZQpBPn5UTokhLrVqnHo0CFPl6SU\nUpcwXaldj8lkKjB7L6xfv557mzfn17Q0KgHDvbz4qWZNVmze7OnSlFJFTE7ZWSiudNeuXcu9LheV\nARPQ3+lk9datBeYvDaVU0VEoQjc8PJwNFguZ535eA4QFB+v2lEqpfKdQhG6nTp0o17Qpd/j781BA\nAA/Y7Uz9/HNPl6WUUpcoFGO6AC6Xi6VLl3LixAnq169PhQoVPF2SUqoIyik7C03o3oy4uDh+++UX\ner/0kqdLUUoVcBq616BNw4b8tm4dO/fs4dZbb/V0OUqpAqxIzF64GStXrmTP1q28ZDbz9uuve7oc\npVQhV+SvdNs0bEjXNWu4D4jy9WVDfLxe7Sqlbphe6V7FypUrWbthA+WAP4CYrKyrXu0uW7aMmDp1\nqFOhAm8MHEh2drbbalVKFQ5X7QZc2CUmJlKnenXevOBvpZLmy/89tGXLFrp06MCEtDTKA/3Hj2dQ\nejqDhg7l6W7d+HnZMkoEBVG/RQsmTJxIYGCge05CKVWgFPnhhQulpqYyffp0TiYm0rJVKxo3bnz+\nuaFDhpD+5pu843IBsBtoFRJCZMWKJK5fTxUR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2jctBFNWzVi2eKVOb9BuYUOLyhVSL0y\ntB+1xsLW7ZtZvXq1p8tR10hDV6kCaM2aNWyJ38StzwqRr6bzytB+ni5JXSMNXaUKoFeG9sOvXhpH\n5oDZV1j56yq92i0gdGtHpQqgGlVrUuxoAMwFR4YDL6/l7Nq1i4YNG3q6NJUDvZGmVAHXp19vPvrq\nA5rXbcOCbxd7upwiTxdHKFWIJSQkUKFKeRqvTWd1MxvLF6+mVq1ani6rSNPZC0oVYm+PeouI/3MR\nEAWR/R28OmyAp0tSOdArXaUKqKSkJEqFlqRUMy/spc1kpwl7v0ljx44dVK5c2dPlFVnaI02pQspu\nt/PpJ9NxOBznHzN3NFOmTBkPVqVyole6SimVi3RMVyml8hENXaWUciMNXaWUciMNXaWUciMNXaWU\nciMNXaWUciMNXaWUciMNXaWUciMNXaWUciMNXaWUciMNXaWUciMNXaWUciMNXaWUciMNXaWUciMN\nXaWUciMNXaWUciMNXaWUciMNXaWUciMNXaWUciMNXaWUciMNXaWUciMNXaWUciMNXaWUciMNXaWU\nciPL1Z40mUzuqkMppYqEK4auiLizDqWUKhJ0eEEppdxIQ1cppdxIQ1cppdxIQ1cppdxIQ1cppdxI\nQ1cppdzo/wEzbZF7AN/ugwAAAABJRU5ErkJggg==\n"
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "y_pred_test = logreg.predict(X_test)\n",
    "plt.scatter(X_test[:, 0], X_test[:, 1], c=y_pred_test, marker='^')\n",
    "plt.scatter(X_train[:, 0], X_train[:, 1], c=y_pred_train)\n",
    "plot_decision_boundary(logreg, X)\n",
    "print \"Accuracy on test set:\", logreg.score(X_test, y_test)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can also take a look at the coefficients, but they probably don't tell you much."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.42842754, -0.62076837]])"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "logreg.coef_"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "MNIST DIGITS\n",
    "-------------\n",
    "Let's go back to the MNIST example of before.\n",
    "This dataset is a bit more exciting since it is much higher dimensional and not as easy to separate.\n",
    "First we load the data again"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.datasets import fetch_mldata\n",
    "mnist = fetch_mldata(\"MNIST original\")\n",
    "X_digits, y_digits = mnist.data, mnist.target"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Remember what the dataset looks like:\n",
    "\n",
    "- 70000 examples, 784 dimensional\n",
    "- ten classes, 0-9\n",
    "- each 784 vector is a 28 * 28 digit"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "X_digits.shape: (70000, 784)\n",
      "Unique entries of y_digits: [ 0.  1.  2.  3.  4.  5.  6.  7.  8.  9.]\n"
     ]
    }
   ],
   "source": [
    "print \"X_digits.shape:\", X_digits.shape\n",
    "print \"Unique entries of y_digits:\", np.unique(y_digits)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.0\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.image.AxesImage at 0xac30b2c>"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPwAAAD5CAYAAAADZljUAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAELJJREFUeJzt3X9MVfX/B/DnrY/YJkgqIjTwR828Buq92AVqEy+2NYYF\nOmtow5qXloKlhtofzdklXWYtzVFTtrwt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+e0XUdZWVlyMzM7BP2f57YevPmTdTW\n1qKwsHAY2yUisyiv8N999x3y8vIwe/bswGORX3vtNdTV1aG5uRlxcXHIy8vDpk2bMH78+H93yis8\nUdSE9ZZ+uA9IRObi9+GJCAADTyQKA08kCANPJAgDTyQIA08kCANPJAgDTyQIA08kCANPJEhEAj/U\n7+pGC/sLD/sLTyT7Y+DB/sLF/sIz4gJPRLGBgScSxLSvxxJR9IT01NrhPhgRRRff0hMJwsATCcLA\nEwnCwBMJwsATCcLAEwnyf5Vj4wB6AR6qAAAAAElFTkSuQmCC\n"
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "print(y_digits[0])\n",
    "plt.rc(\"image\", cmap=\"binary\")\n",
    "plt.matshow(X_digits[0].reshape(28, 28))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We could try to learn all ten classes with logistic regression, but let us keep with two classes for the moment.\n",
    "We will use two classes that are quite hard to distinguish: seven and nine.\n",
    "\n",
    "To create a dataset only consisting of the classes zero and one, we need a new numpy trick!\n",
    "\n",
    "We can not only slice our data using ranges, like ``X[5:10]``, we can also select elements using conditions, like so:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "zeros.shape:  (6903, 784)\n",
      "ones.shape:  (7877, 784)\n"
     ]
    }
   ],
   "source": [
    "zeros = X_digits[y_digits==0]  # select all the rows of X where y is zero (i.e. the zeros)\n",
    "ones = X_digits[y_digits==1]   # select all the rows of X where y is one (i.e. the ones)\n",
    "print \"zeros.shape: \", zeros.shape\n",
    "print \"ones.shape: \", ones.shape"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Lets have a quick look to see that we did it right."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.image.AxesImage at 0xaea1fac>"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPwAAAD5CAYAAAADZljUAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAD2RJREFUeJzt3X9MVfUfx/HX/fJV/gjyR/xs4K+WYKCCjR9zSTfbGsMJ\nmn+YTk1gM4FKM/3P2XW1zDWzYk3dFGtzuLLNyiyZrh1/sCVsgStGSyvSGSq0iltaQzvfP76TVOQA\n93LuvfB5Pja363kfz3nvbC8/53PPj+uxbdsWACP8J9wNAAgdAg8YhMADBiHwgEEIPGAQAg8YxPXA\nnzhxQtOmTdODDz6o6upqt3c3aJMmTdKMGTOUnZ2t3NzccLejsrIyJSYmavr06T3L/H6/SkpKNGHC\nBC1YsEB//PFHRPXn8/mUkpKi7OxsZWdn68iRI2Hr78KFC3rssceUkZEhr9er2tpaSZFzDPvqL2TH\n0HZZVlaWffz4cbutrc1OS0uzOzo63N7loEyaNMn+5Zdfwt1GjxMnTthfffWVnZmZ2bNs69at9rPP\nPmv/9ddfdlVVlf36669HVH8+n8/etm1b2Hq6VXt7u93U1GTbtm13dHTYkydPtru6uiLmGPbVX6iO\noasj/O+//y5JKigo0MSJE/XEE0/o9OnTbu4yIHYE3Xs0Z84cjRs37rZlDQ0NKi8vV3R0tMrKysJ6\nDO/WnxQ5xzApKUlZWVmSpLi4OGVkZKixsTFijmFf/UmhOYauBr6xsVHp6ek9f3/ooYf05ZdfurnL\nQfN4PJo7d64WLFigTz75JNzt3NWtxzE9PV0NDQ1h7qi36upq5efna+vWrfL7/eFuR5J07tw5tbS0\nKDc3NyKP4c3+8vLyJIXmGBr/pV19fb3OnDmjLVu2aN26dbp06VK4W+olUkbPvlRUVOjHH39UXV2d\nvv/+e+3atSvcLcnv92vx4sXavn27YmJiIu4Y3trfPffcE7Jj6Grgc3Jy9O233/b8vaWlRfn5+W7u\nctCSk5MlSdOmTVNxcbE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IE+qxsu9Bcc+gtOKPsj8KK/YNFfcEZc4AFEBgIPGMS1x2MBhE9Ab60d6p0BCC9O\n6QGDEHjAIAQeMAiBBwxC4AGDEHjAIP8DN0RXkNApfJkAAAAASUVORK5CYII=\n"
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.matshow(ones[0].reshape(28, 28))  # change the 0 to another number to see some more zeros. Or try looking at some ones."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now, we generate some new data set.\n",
    "\n",
    "For the training labels y, we write as many 0's as the ``zeros`` array is long, the asame for ``ones``."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "X_new.shape:  (14780, 784)\n",
      "y_new.shape:  (14780,)\n",
      "y_new:  [0 0 0 ..., 1 1 1]\n"
     ]
    }
   ],
   "source": [
    "X_new = np.vstack([zeros, ones])  # this \"stacks\" sevens and nines vertically\n",
    "print \"X_new.shape: \", X_new.shape\n",
    "y_new = np.hstack([np.repeat(0, zeros.shape[0]), np.repeat(1, ones.shape[0])])\n",
    "print \"y_new.shape: \", y_new.shape\n",
    "print \"y_new: \", y_new"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now we shuffle them around and create a training and test dataset."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.utils import shuffle\n",
    "X_new, y_new = shuffle(X_new, y_new)\n",
    "X_mnist_train = X_new[:5000]\n",
    "y_mnist_train = y_new[:5000]\n",
    "X_mnist_test = X_new[5000:]\n",
    "y_mnist_test = y_new[5000:]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now let us learn a logistic regression model."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LogisticRegression(C=1.0, class_weight=None, dual=False, fit_intercept=True,\n",
       "          intercept_scaling=1, penalty='l2', random_state=None, tol=0.0001)"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "logreg.fit(X_mnist_train, y_mnist_train)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "... and visualize the coefficients.\n",
    "\n",
    "We can see that the middle is dark, corresponding to  high positive values for where\n",
    "a 1 would be. Around it is a lighter circle, corresponding to the position of a 0."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.colorbar.Colorbar instance at 0xb325564c>"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAARQAAADtCAYAAAB+moocAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X9UVHX+P/DnoKCmpk5CoPxyhOYHmiDMjJsErZWiHEFX\nd11aqSO4TWhhGdZ62q0+52w/d1t/sKacY1S7hHu29XCiWmWxDg7awmCiFgIpQSD5A7BiNsnA3t8/\n+M49DNz3ZZi5MzjM63HOnAPvue973/cyvObe+7rv91vBGGMghBAZ+I12AwghYwcFFEKIbCigEEJk\nQwGFECIbCiiEENlQQCFEJkqlEgqFwqGXUqkc7ea6hYLSxoTIQ6FQjGj5sfivN360G0DIWOJoUBmL\nwQSggEKIrHw9oNA9FEJk5Og9FB6z2QytVovo6Gjk5+eLLrN9+3aoVCrEx8ejoaHBobpvvvkmtFot\nYmJi8PTTTwvlu3fvRnR0NHQ6HY4dO+bi3gNghBBZAGD+/v4OvXj/erGxsezo0aOspaWFqdVq1tHR\nYfd+dXU1W7x4Mevq6mLFxcUsNTV12LqfffYZW7RoEfviiy8YY4xduXKFMcbY5cuXmVqtZl999RWr\nqKhgcXFxLh8DOkMhREaunKF89913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yFF15w+kva1h6p+gaDAefOncOxY8ewcuVKtLe3D1ne0e1TQCFERq6khMvLy7nvvf32\n26ivr0dcXBzq6+uh1+uHLKPX67Ft2zbh97q6OmHweL1eP2z9xMREzJ49G+fOnYNarcbly5eF986e\nPYtFixYNuw90U5YQGbnrpqzRaERhYSF6enpQWFgo+s89bdo0AP2ZnpaWFpSXl8NoNErWb2lpEWZh\nOHPmDK5fvy6MWKfRaPCPf/wDnZ2dKCkpEdYlafjbQYQQRwBgV65cceg10n+97u5ulpaWxsLCwlh6\nejqzWq2MMcba29vZihUrhOUqKiqYRqNhc+fOZbt27Rq2/t///ncWExPDYmNj2bp161hlZaVQp66u\njsXFxbHIyEj2u9/9zqF2Kv7/gSCEuEihUKCjo8OhZQMDA8dk8oLuoRAio7H8FKwjKKAQIiMKKIQQ\n2Yzljn+OoIBCiIzoDIUQIhsKKIQQ2VBAIYTIhgIKIUQ2FFAIIbKhgEIIkQ2ljQkhsqEzFEKIbCig\nEEJkQwGFECIbCiiEENlQQCGEyIYCCiFENuPGjXNouRkzZri5JaODAgohMhmLI7CNlG8/hUMIkRUF\nFEKIbCigEEJkQwGFECIbCiiEENlQQCGEyOb/AX+QUIg/zZM4AAAAAElFTkSuQmCC\n"
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.matshow(logreg.coef_.reshape(28, 28))\n",
    "plt.colorbar()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Finally, let as look at the accuracy on training and test set:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Accuracy training set: 1.0\n",
      "Accuracy test set: 0.998466257669\n"
     ]
    }
   ],
   "source": [
    "print \"Accuracy training set:\", logreg.score(X_mnist_train, y_mnist_train)\n",
    "print \"Accuracy test set:\", logreg.score(X_mnist_test, y_mnist_test)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Playing around with this notebook\n",
    "=================================\n",
    "1. What would be the accuracy of a completely random predictor on the first dataset?\n",
    "\n",
    "2. Can you still pick out the class yourself if you set the ``cluster_std`` to ``10`` in ``make_blobs``? Can logistic regression do it?\n",
    "\n",
    "3. Try to separate some other digit classes from MNIST. Which are hard, which are not?\n",
    "\n",
    "4. Visualize the classes 0 and 1 using PCA down to two dimensions. Use a scatter plot as above. Would you expect they can be separated with a linear classifier?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
